﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Media;
using JHoelsch.DataClases.DataBase;
namespace JHoelsch.Gui.View
{
    public partial class MainWindow
    {
        private void NotifyPropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        }     
        private void updateActiveCar()
        {
            if (CarList.Count != 0)
            {
                ActiveCar = CarList.First();
                overViewGrid.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                Car newCar = new Car();
                newCar.Name = "no car loaded";
                ActiveCar = newCar;
                overViewGrid.Visibility = System.Windows.Visibility.Hidden;
            }   
        }
        private Brush getColor()
        {
            if (m_colors.Count == 0)
            {
                initColors();

            }
            Brush retVal = m_colors.First();
            m_colors.RemoveAt(0);
            return retVal;
        }
        private void initColors()
        {
            m_colors.Add(Brushes.Navy);
            m_colors.Add(Brushes.DarkOrange);
            m_colors.Add(Brushes.DarkGray);
            m_colors.Add(Brushes.DarkGreen);
            m_colors.Add(Brushes.OrangeRed);
            m_colors.Add(Brushes.DarkMagenta);
        }
    }
}
